/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.lt.cj.core.filters;

import java.util.List;
import org.lt.cj.config.entities.ConfigModel;
import org.lt.cj.config.util.RegCheck;
import org.lt.cj.core.LinkFilter;

/**
 * 链接过滤器
 * @author luohong
 */
public class LinkFilterImpl implements LinkFilter {

    private ConfigModel configModel;

    public LinkFilterImpl(ConfigModel configModel) {
        this.configModel = configModel;
    }

    public boolean accept(String url) {

        List fitUrls = configModel.getFitUrlRegs();
        RegCheck regChecker = RegCheck.getInstance();
        //提取以包含匹配字符串的链接
        boolean result = regChecker.checkUrl(url, fitUrls);
        return result;
    }
}
